#include <myheader_c_plus.h>
#include <functional>
using std::function;
using std::endl;
using std::cout;
using std::bind;
void func(int x1, int x2, int x3, const int &x4, int x5)
{
    cout << "x1 = " << x1 << endl
         << "x2 = " << x2 << endl
         << "x3 = " << x3 << endl
         << "x4 = " << x4 << endl
         << "x5 = " << x5 << endl;
}

int multiple(int x, int y, int z)
{
    return x * y * z;

}
class Example
{
public:
    Example(){}
    int add(int x, int y, int z)
    {
        return x + y + z;
    }

private:
    int _x;

};
double add(double x, int y, int z)
{
    return x + y + z;
}

void test()
{
    // int number = 100;
    using namespace std::placeholders;
    // number = 111;
    
}

void test1()
{

    using namespace std::placeholders;
    function<int(int)> f = bind(&multiple, 10,_1,30);
    cout << f(100);
    
    function<double(double,int)> f2 = bind(add, 20.1, 10, _1); 
    cout << f2(1,20);

    Example e;
    function<int(Example *, int)> f3 = bind(&Example::add,_1, 10, _2, 20);
    cout << f3(&e, 10) << endl;

}
int main(int argc, char *argv[])
{
    test1();
    return 0;
}

